package com.pet.server.ext.util.logger;


import com.pet.server.ext.Logger;
import com.pet.server.ext.data.Parameter;
import com.pet.server.ext.util.StringUtil;

public class LoggerManager {
	public final static String kt="\t";
	
	public static void loggerInit(Parameter param,String tag){
    	Logger.getLogger("init").logInfo(logStr(param.remote_client_ip,tag));
    }
	public static void loggerDown(Parameter param,Integer userId){
		Logger.getLogger("down").logInfo(logStr(userId));
	}
	public static void loggerActivate(Parameter param,Integer userId){
		Logger.getLogger("activate").logInfo(logStr(userId));
	}
	public static String logStr(Object ...strings){
    	boolean b = true;
    	StringBuffer sbuf = new StringBuffer();
    	for(Object o:strings){
    		String s = StringUtil.dealNull(o);
    		sbuf.append(b?s:kt+s);
    		if(b){b=false;}
    	}
    	return sbuf.toString();
    }
    
}
